<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>01_JS回顾</title>
</head>
<body>

<script>
    var a=10;
    var b=2.2;
    var c="hello";
    var c1='hello';
    var d=true;
    var e=false;
    var f;
    console.log(a,typeof a);/* number*/
    console.log(b,typeof b);/* number*/
    console.log(c,typeof c);/* string*/
    console.log(c1,typeof c1);/* string*/
    console.log(d,typeof d);/* boolean*/
    console.log(e,typeof e);/* boolean*/
    console.log(f,typeof f);/* undefined*/

    let obj ={};
    console.log(obj,typeof obj);
    obj.like="过年好";
    console.log(obj,typeof obj,obj.like);

    let arr=[1,true,'hello'];
    console.log(arr,typeof arr);
    /* 没有值的时候显示为undefined*/
    console.log(arr[0],arr[1],arr[2],arr[99]);

    console.log(Number('23'),typeof Number('23'));
    console.log(Number(true),typeof Number(true));
    console.log(Number(false),typeof Number(false));
    console.log(Number('你好'),typeof Number('你好'));
    console.log(Number('1a'),typeof Number('1a'));


    console.log(Boolean(0));
    console.log(Boolean(null));
    console.log(Boolean(''));
    console.log(Boolean(NaN));
    console.log(Boolean(undefined));
    console.log(Boolean(' '));
    console.log(Boolean('你好'));
    console.log(Boolean(6666));

    let x=1;
    let y=true;
    console.log(x==y);/* 松散比较*/
    console.log(x===y);/* 严格比较*/
    console.log(3>7);
    console.log(3>'7');
    console.log('3'>'7');/* 比较unicod 编码*/
    console.log('3'.charCodeAt());
    console.log('7'.charCodeAt());

</script>
</body>
</html>